import { AbstractModelPermissionPK, OperationLog, Organization, SparrowEntity } from "./sparrow";

export interface Group extends SparrowEntity{
  code?: string;
	name: string;
	owner?: string;
	stat?: string;
  organizationIds?: string[];
  type?: string;
  root?:boolean;
}

export interface GroupMember{
  groupRelations?:GroupRelation[];
	groupOrganizations?:GroupOrganization[];
	groupRoles?: GroupRole[];
	groupLevels?: GroupLevel[];
	groupSysroles?: GroupSysrole[];
	groupEmployees?: GroupEmployee[];
}



export interface OrganizationGroup extends OperationLog{
  id: OrganizationGroupPK;
  stat: string;
  organization?: Organization;
  group?:Group;
}

export interface GroupRelation extends OperationLog{
  id: GroupRelationPK;
}

export interface GroupOrganization extends OperationLog{
  id: GroupOrganizationPK;
}

export interface GroupRole extends OperationLog{
  id: GroupRolePK;
}

export interface GroupLevel extends OperationLog{
  id: GroupLevelPK;
}

export interface GroupSysrole extends OperationLog{
  id: GroupSysrolePK;
}

export interface GroupEmployee extends OperationLog{
  id: GroupEmployeePK;
}

export interface OrganizationGroupPK{
  organizationId: string;
  groupId: string;
}

export interface GroupRelationPK{
  groupId: string;
  parentId: string;
}

export interface GroupOrganizationPK  {
  groupId: string;
  organizationId: string;
}

export interface GroupRolePK  {
  groupId: string;
  roleId: string;
}

export interface GroupLevelPK  {
  groupId: string;
  positionLevelId: string;
}

export interface GroupSysrolePK  {
  groupId: string;
  sysroleId: string;
}

export interface GroupEmployeePK  {
  groupId: string;
  employeeId: string;
}

export interface GroupModelPermissionPK extends AbstractModelPermissionPK {
  groupId: string;
}
